package com.ptswitch.material.pages.material;

import org.apache.tapestry5.EventConstants;
import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.util.TextStreamResponse;

import com.ptswitch.material.service.MaterialService;

public class EmptyCode {
    @Inject
    private MaterialService materialSer;

    @OnEvent(value = EventConstants.ACTIVATE)
    Object emptyCode(String prefix) {
        String code = materialSer.emptyCode(prefix);
        return new TextStreamResponse("html/txt", code);
    }
}
